class Job < ActiveRecord::Base
  
  validates_presence_of :jid, :job_title, :location, :description, :sector_id
  validates_uniqueness_of :jid
  belongs_to :sector
  
  after_save :update_sitemap

private
  def update_sitemap
    require 'curb'
    Curl::Easy.perform("www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fcareermindedpeople.com%2Fsitemap")
  end
end